Text-component Module
This is a sub-module belong to minecraft-launcher-core module. You can still use this individually.
Usage
TextComponent
Create TextComponent from string OR Minecraft's formatted string, like '§cThis is red'
import { TextComponent } from "@xmcl/text-component";
const fromString: TextComponent = TextComponent.str("from string");
const formattedString: string;
const fromFormatted: TextComponent = TextComponent.from(formattedString);
Render the TextComponent to css
import { TextComponent } from "@xmcl/text-component";
const yourComponent: TextComponent;
const hint: Array<{ style: string; text: string }> = TextComponent.render(yourComponent);